/*
 * MCU.h
 *
 * Created on: 2021-12-1
 *     Author: tangjie
 */

#ifndef MCU_MCU_H_
#define MCU_MCU_H_


#include "Cpu.h"



#define DEV_LEFT				1
#define DEV_RIGHT				2
#define TRUNK_TURN_LEFT_CNT		5
#define TRUNK_TURN_RIGHT_CNT	5
#define FENDER_TURN_CNT			10

typedef enum
{
	eInput,
	eOutput,
}PinDir_E;


typedef enum
{
	/* Output Pins */
	/* Input Pins */
	ePin_WEL_DET = 0,
	ePin_SL_DET,
	ePin_DI_DET,
	ePin_PO_DET,
	ePin_MAX,
}PinType_E;


typedef struct 
{
	uint8_t Open_Short_Fault_Left;
	uint8_t Board_Loss_Fault_Left;
	uint8_t Open_Short_Fault_Right;
	uint8_t Board_Loss_Fault_Right;
}Trunk_Diag_Status_t;

typedef struct 
{
	uint8_t Open_Short_Fault;
	uint8_t Board_Loss_Fault;
}Fender_Diag_Status_t;


#define  FTM_PWM_DUTY_MAX   ((uint16_t)1000)


extern void timeOut(uint32_t timeOut);

extern void MCU_Init(void);

extern void MCU_FeedWdg(void);


#endif /* MCU_MCU_H_ */
